//
//  JieChuCell.m
//  BrushFace
//
//  Created by timer_q on 15/12/26.
//  Copyright © 2015年 Zzz. All rights reserved.
//

#import "JieChuCell.h"
#import "NavHelper.h"

@implementation JieChuCell

- (void)awakeFromNib {
    // Initialization code
    self.processBackView.layer.cornerRadius = 5;
    self.processView.layer.cornerRadius = 5;
    self.processBackView.clipsToBounds = YES;
    self.processView.clipsToBounds = YES;
    self.cellHeaderImage.layer.cornerRadius = self.cellHeaderImage.frame.size.height/2.0;
    self.cellHeaderImage.clipsToBounds = YES;
    
}
- (void)cellType:(NSInteger)type{
        _currentType = type;
        self.processBackView.hidden = YES;
        self.cellButton.hidden = NO;
            if (type == AR_ED||type == 10) {
                [self.cellButton setTitle:@"已还款" forState:UIControlStateNormal];
                [self.cellButton setBackgroundImage:[UIImage imageNamed:@"jiechuyihuan"] forState:UIControlStateNormal];
            }else if(type == AR_FAIL||type == 6){
                [self.cellButton setTitle:@"系统已取消" forState:UIControlStateNormal];
                [self.cellButton setBackgroundImage:[UIImage imageNamed:@"jiechuliubiao"] forState:UIControlStateNormal];
            }else if(type == AR_FULL||type == 700){
                [self.cellButton setTitle:@"已满标" forState:UIControlStateNormal];
                [self.cellButton setBackgroundImage:[UIImage imageNamed:@"jiechumanbiao"] forState:UIControlStateNormal];
            }else if (type == AR_REFUND_ING||type ==3||type == 13||type == 9) {
                [self.cellButton setTitle:@"还款中" forState:UIControlStateNormal];
                [self.cellButton setBackgroundImage:[UIImage imageNamed:@"jiechuanhuangkuanzhong"] forState:UIControlStateNormal];
            }else if(type == AR_BORROW_ING||type==0||type==11||type==12){
                self.processBackView.hidden = NO;
                self.cellButton.hidden = YES;
            }else{
                [self.cellButton setTitle:@"已逾期" forState:UIControlStateNormal];
                [self.cellButton setBackgroundImage:[UIImage imageNamed:@"jiechuyuqi"] forState:UIControlStateNormal];
            }
}

- (IBAction)headerImageButtonClikc:(id)sender {
    [NavHelper gotoContactDetailVCWithUserId:self.userid];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
